package com.mooral.web.tag.html;

import javax.servlet.jsp.JspException;

import com.mooral.web.util.SlugUtils;

public class FormTag extends org.apache.struts.taglib.html.FormTag {
    protected void renderAction(StringBuffer results) {
    	
    	StringBuffer temp = new StringBuffer();
    	
    	super.renderAction(temp);
    	
    	SlugUtils slugUtils = new SlugUtils();
    	
    	if(slugUtils.isActionSlugMapped(action)){
    		String tempString = temp.toString();
    		results.append(tempString.substring(0, tempString.indexOf(action)) + (new SlugUtils()).getActionSlug(action)+ "\"");
    		//results.append(temp.toString().replaceAll(action + ".do", (new SlugUtils()).getActionSlug(action)));
    	} else {
    	   	results.append(temp);
    	}
	}
}
